import request from '@/config/axios'

export function useBannerApi() {
    return {
        // 列表
        getList: async (params: any) => {
            return await request.get({url: '/yxt/banner/list', params})
        },
        // 查询
        getObj: async (id: number) => {
            return await request.get({url: '/yxt/banner/get?id=' + id})
        },
        // 创建
        createObj: (data: any) => {
            return request.post({url: '/yxt/banner/create', data})
        },
        // 更新
        updateObj: (data: any) => {
            return request.post({url: '/yxt/banner/update', data})
        },
        // 删除
        deleteObj: async (id: number) => {
            return await request.delete({url: '/yxt/banner/delete?id=' + id})
        },
    }
}
